package com.heima.utils.common;

import lombok.Data;

@Data
public class UserThreadLocal {
    private static final ThreadLocal<Integer> USR_THREAD_LOCAL = new ThreadLocal<>();
    public static void setUserId(Integer id){
        USR_THREAD_LOCAL.set(id);
    }


    public static Integer getUserId(){
       return USR_THREAD_LOCAL.get();
    }

    public static void removeUserId(){
        USR_THREAD_LOCAL.remove();
    }
}
